package com.Jano.controller;/**
 * @ClassName : JwtController
 * @Description : 刷新Jwt令牌
 * @Author : Jano
 * @Date: 2022-07-16 16:02
 */

import com.Jano.annotation.LogAnnotation;
import com.Jano.dto.JsonResult;
import com.Jano.model.UserModel;
import com.Jano.service.JwtService;
import com.Jano.util.jwt.JwtTokenUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;
import java.util.Map;

/**
 * 刷新Jwt令牌
 *
 * @author zoumaoji
 * @date 2022/07/16 16:02
 **/
@RestController
@RequestMapping("/jwt")
public class JwtController {
    @Autowired
    JwtService jwtService;

    @RequestMapping("/refreshToken")
    @LogAnnotation(title = "Jwt模块", action = "刷新令牌")
    public JsonResult refreshToken(String refreshToken, HttpSession session) {
        JsonResult jsonResult = jwtService.refreshToken(refreshToken,session);
        return jsonResult;
    }
}
